'use strict'

let urljoin = require("url-join");

const QYWX_API_HOST = "https://qyapi.weixin.qq.com/cgi-bin";
const URLs = {
	GET_ACCESS_TOKEN: urljoin(QYWX_API_HOST, "gettoken?corpid=${corpId}&corpsecret=${corpSecret}"),

  ///below is departments apis
	CONTACTS_DEPARTMENT_LIST: urljoin(QYWX_API_HOST, "department/list?access_token=${accessToken}&id=${departmentId}"),
	CONTACTS_DEPARTMENT_CREATE: urljoin(QYWX_API_HOST, "department/create?access_token=${accessToken}"),
	CONTACTS_DEPARTMENT_UPDATE: urljoin(QYWX_API_HOST, "department/update?access_token=${accessToken}"),
	CONTACTS_DEPARTMENT_DELETE: urljoin(QYWX_API_HOST, "department/delete?access_token=${accessToken}"),

  /****************成员管理接口/****************/
	//添加成员信息
	CONTACTS_MEMBER_CREATE: urljoin(QYWX_API_HOST, "user/create?access_token=${accessToken}"),
	//更新成员信息
	CONTACTS_MEMBER_UPDATE: urljoin(QYWX_API_HOST, "user/update?access_token=${accessToken}"),
	//获取成员
	CONTACTS_MEMBER_GET: urljoin(QYWX_API_HOST, "user/get?access_token=${accessToken}"),
	//删除成员
	CONTACTS_MEMBER_DELETE: urljoin(QYWX_API_HOST, "user/delete?access_token=${accessToken}"),
	//批量删除成员
	CONTACTS_MEMBER_BATCHDELETEDELETE: urljoin(QYWX_API_HOST, "user/batchdelete?access_token=${accessToken}"),
	//获取部门成员
	CONTACTS_MEMBER_SIMPLELIST: urljoin(QYWX_API_HOST, "user/simplelist?access_token=${accessToken}"),
	//获取部门成员详情
	CONTACTS_MEMBER_LISTDETAIL: urljoin(QYWX_API_HOST, "user/list?access_token=${accessToken}"),
	/****************异步任务接口****************/
	// CONTACTS_BATCH_INVITESEND: urljoin(QYWX_API_HOST, "invite/send?access_token=${accessToken}"),
	/****************管理标签接口****************/
	//创建标签
	CONTACTS_TAG_CREATE: urljoin(QYWX_API_HOST, "tag/create?access_token=${accessToken}"),
	//获取标签列表
	CONTACTS_TAG_LIST: urljoin(QYWX_API_HOST, "tag/list?access_token=${accessToken}"),
	//更新标签
	CONTACTS_TAG_UPDATE: urljoin(QYWX_API_HOST, "tag/update?access_token=${accessToken}"),
	//删除标签
	CONTACTS_TAG_DELETE: urljoin(QYWX_API_HOST, "tag/delete?access_token=${accessToken}"),
	//获取标签成员
	CONTACTS_TAG_GET: urljoin(QYWX_API_HOST, "tag/get?access_token=${accessToken}"),
	/****************管理素材文件****************/
	//上传临时素材
	CONTACTS_MEDIA_UPLOAD: urljoin(QYWX_API_HOST, "media/upload?access_token=${accessToken}"),
	//获取临时素材
	CONTACTS_MEDIA_GET:urljoin(QYWX_API_HOST, "media/get?access_token=${accessToken}"),

}

module.exports.URLs = function() {
	return URLs;
}
